Magnetic field sensor to detect direction of angular rotation of a rotating magnetic structure, speed of the rotating magnetic structure or fault

ABSTRACT

In one aspect, an integrated circuit (IC) includes a magnetic field sensor to detect speed and direction of angular rotation of a rotating magnetic structure. The magnetic field sensor includes at least two magnetic field sensing elements configured to sense changes in a magnetic field caused by rotation of the magnetic structure. The IC also includes an output port configured to provide an output signal of the magnetic field sensor. The output signal indicates the angular direction and one of the speed or a fault.

BACKGROUND

Traditionally, a Hall effect sensor with two Hall elements and with dualoutputs in quadrature will switch on or off in the presence or absenceof a magnetic field of sufficient strength to provide rotational speedand rotational direction information. The lead or lag switching ofeither Hall element, compared to the other Hall element is used todetermine the direction rotation of a ring magnet. In common solutionsthat employ speed and direction sensing using Hall latches, two Hallsensor output nodes or signals are required (i.e., two Hall sensoroutputs or one Hall sensor output and a direction signal).

SUMMARY

In one aspect, an integrated circuit (IC) includes a magnetic fieldsensor to detect speed and direction of angular rotation of a rotatingmagnetic structure. The magnetic field sensor includes at least twomagnetic field sensing elements configured to sense changes in amagnetic field caused by rotation of the magnetic structure. The IC alsoincludes an output port configured to provide an output signal of themagnetic field sensor. The output signal indicates the angular directionand one of the speed or a fault.

In another aspect, an IC includes a magnetic field sensor means todetect speed and direction of angular rotation of a rotating magneticstructure. The magnetic field sensor means includes a means to sensechanges in a magnetic field caused by rotation of the magneticstructure. The IC also includes an output port configured to provide anoutput signal of the magnetic field sensor means. The output signalindicates the angular direction and one of the speed or a fault.

DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram of an example of an integrated circuit (IC)and a rotating magnetic structure.

FIG. 1B is diagram of an example of the rotating magnetic structure.

FIG. 2 is a graph of an example of an output signal of the IC of FIG. 1.

FIG. 3 is block diagram of an example of a magnetic field sensor.

FIG. 4A are waveforms of examples of outputs of two magnetic fieldsensing elements.

FIG. 4B are waveforms of examples of outputs of two magnetic fieldsensing elements after a respective converter.

FIG. 5 is block diagram of an example of a frequency-locked loop (FLL).

FIG. 6 is block diagram of an example of output current circuitry.

FIG. 7 is a logic diagram of an example of a decoder.

FIG. 8A is block diagram of an example of a voltage regulator.

FIG. 8B is circuit diagram of an example of a two-wire circuitry.

FIG. 9 is a logic diagram of an example of a frequency detector.

FIG. 10 is circuit diagram of an example of a charge pump and a filter.

FIG. 11 is a graph of examples of waveforms of signals used in FIGS. 9and 10.

FIG. 12A is a block diagram of another example of the magnetic fieldsensor.

FIG. 12B is a graph of an example of frequency of an output signal tothe magnetic field sensor of FIG. 12A.

FIG. 13 is a diagram of another example of output current circuitry.

FIG. 14 is a table of example responses to select control signals for ananalog multiplexor.

FIG. 15A is a logic diagram of an example of an analog multiplexor inputselect control receiving two control signals.

FIG. 15B is a circuit diagram of an example of a fault voltage block.

FIG. 15C is a logic diagram of an example of an analog multiplexor.

FIG. 15D is a table of example select control signals to an analogmultiplexor.

FIG. 16 is a graph of further example of an output signal to the IC ofFIG. 1.

FIG. 17 is block diagram of a further example of an output currentcircuitry.

FIG. 18 is a logic diagram of an example of a decoder.

FIG. 19 is a circuit diagram of a further example of two-wire circuitry.

FIG. 20 is a graph of an example of frequency of an output signal of amagnetic field sensor of FIG. 21.

FIGS. 21 to 24 are block diagrams of a still further example of themagnetic field sensor.

FIG. 25 is a logic diagram of an example of an analog multiplexor inputselect control receiving three control signals.

FIG. 26 is a table of example responses to select control signals for ananalog multiplexor.

FIG. 27 is a graph of an example of duty cycle of a pulse widthmodulation (PWM) output of a magnetic field sensor of FIG. 28.

FIG. 28 is a block diagram of another example of a magnetic sensor.

FIG. 29 is a flowchart of an example of a process to generate a PWMoutput.

FIG. 30 is a block diagram of an example of digital circuitry to performthe process in FIG. 29.

DETAIL DESCRIPTION

Described herein are techniques to provide a signal indicating a speedof a rotating magnetic structure, a direction of angular rotation of themagnetic structure and/or one or more faults. Unlike traditionalsensors, the sensor described herein provides the speed of the rotatingmagnetic structure, the direction of angular rotation of the magneticstructure and/or the one or more faults using a two-wire output.

As used herein, the term “magnetic field sensor” is used to describe acircuit that uses a magnetic field sensing element, generally incombination with other circuits. Magnetic field sensors are used in avariety of applications, including, but not limited to, an angle sensorthat senses an angle of a direction of a magnetic field, a currentsensor that senses a magnetic field generated by a current carried by acurrent-carrying conductor, a magnetic switch that senses the proximityof a ferromagnetic object, a rotation detector that senses passingferromagnetic articles, for example, magnetic domains of a ring magnetor a ferromagnetic target (e.g., gear teeth) where the magnetic fieldsensor is used in combination with a back-biased or other magnet, and amagnetic field sensor that senses a magnetic field density of a magneticfield.

As used herein, the term “magnetic field sensing element” is used todescribe a variety of electronic elements that can sense a magneticfield. The magnetic field sensing element can be, but is not limited to,a Hall effect element, a magnetoresistance element, or amagnetotransistor. As is known, there are different types of Hall effectelements, for example, a planar Hall element, a vertical Hall element,and a Circular Vertical Hall (CVH) element. As is also known, there aredifferent types of magnetoresistance elements, for example, asemiconductor magnetoresistance element such as Indium Antimonide(InSb), a giant magnetoresistance (GMR) element, for example, a spinvalve, an anisotropic magnetoresistance element (AMR), a tunnelingmagnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ).The magnetic field sensing element may be a single element or,alternatively, may include two or more magnetic field sensing elementsarranged in various configurations, e.g., a half bridge or full(Wheatstone) bridge. Depending on the device type and other applicationrequirements, the magnetic field sensing element may be a device made ofa type IV semiconductor material such as Silicon (Si) or Germanium (Ge),or a type III-V semiconductor material like Gallium-Arsenide (GaAs) oran Indium compound, e.g., Indium-Antimonide (InSb).

As is known, some of the above-described magnetic field sensing elementstend to have an axis of maximum sensitivity parallel to a substrate thatsupports the magnetic field sensing element, and others of theabove-described magnetic field sensing elements tend to have an axis ofmaximum sensitivity perpendicular to a substrate that supports themagnetic field sensing element. In particular, planar Hall elements tendto have axes of sensitivity perpendicular to a substrate, while metalbased or metallic magnetoresistance elements (e.g., GMR, TMR, AMR) andvertical Hall elements tend to have axes of sensitivity parallel to asubstrate.

As used herein, a fault may include any condition that identifies anerror or diagnostic condition. A fault may include but is not limited toa loose wire, a temperature of an integrated circuit being too hot ortoo cold, an air gap between a magnet and a sensor being too big or toosmall, a component (e.g., an oscillator, a regulator and so forth)performing out of specification.

Referring to FIGS. 1A and 1B, an example of an integrated circuit (IC)to detect speed and direction of angular rotation of a rotating magneticstructure is an IC 120. The IC 120 includes a magnetic field sensor 130that detects a speed and a direction of angular rotation of a rotatingmagnetic structure 140 and provides an output signal 160 indicating thespeed of the rotating magnetic structure 140, the direction of angularrotation of the magnetic structure 140 and/or one or more faults. In oneexample, a rotating magnetic structure 140 is a ring magnet 140′.

Referring to FIG. 2, in one example, the output signal 160 of the IC 120may be an output current signal, Iout 160′ which indicates the speed ofthe rotating magnetic structure 140 and the direction of angularrotation of the magnetic structure 140. In one example, the Iout 160′ isa current signal that may be at one of four current levels, I_(CC1),I_(CC2), I_(CC3) and I_(CC4). In one example, when the Iout 160′alternates between I_(CC2) and I_(CC3), the rotating magnetic structure140 is moving in direction 1 (e.g., either clockwise or counterclockwise) and when the Iout 160′ alternates between I_(CC1) andI_(CC4), the rotating magnetic structure 140 is moving in direction 2,opposite direction 1. The faster the Iout 160′ transitions betweenI_(CC2) and I_(CC3) (i.e., frequency) or the faster the Iout 160′transitions between I_(CC1) and I_(CC4) (i.e., frequency) the faster thespeed the magnetic rotating structure 140 is turning.

Referring to FIG. 3, one example of the magnetic field sensor 130 is amagnetic field sensor 130′. The magnetic field sensor 130′ includes amagnetic field sensing element 302 a, a magnetic field sensing element302 b, a converter 308 a, a converter 308 b, a digital processingcircuitry 312, an output current circuitry 318 and a frequency-lockedloop (FLL) 320.

The magnetic field sensing element 302 a sends an analog signal 322 abased on the magnetic field sensed from the rotating magnetic structure140 to the converter 308 a, which provides a digital signal 332 a to thedigital processing circuitry 312 and the FLL 320. As used herein, thesecomponents are part of a Channel A.

The magnetic field sensing element 302 b sends an analog signal 322 bbased on the magnetic field sensed from the rotating magnetic structure140 to the converter 308 b, which provides a digital signal 332 b to thedigital processing circuitry 312 and the FLL 320. As used herein, thesecomponents are part of a Channel B.

FIG. 4A depicts an example of analog signals 322 a, 322 b. FIG. 4Bdepicts an example of digital signals 332 a, 332 b.

Referring back to FIG. 3, the digital processing circuitry 312 receivesan output signal 360 from FLL 320 along with signals 332 a, 332 b andprovides a direction signal, DIR, which indicates a direction of angularrotation of the rotating magnetic structure 140 and a signal, XOR to theoutput current circuitry 318. The output current circuitry 318 providesthe IC output signal 160′.

In one example, the XOR signal is like an “edge stripped signal”, whichfor every rising and falling edge of a signal, the XOR signal has arising edge that conveys the information that channel A or B signalchanged state. In one embodiment, the XOR signal will have a statetransition for every rising and falling edge of signal A and B. Everyedge of signal A and B will cause the XOR signal to change state, sothat the signal XOR is a logic signal that gives a summary of all themagnetic switchpoints of both logic signals/channels.

Referring to FIG. 5, an example of the FLL 320 is an FLL 320′. The FLL320′ includes voltage-controlled oscillator (VCO) 518, which generatedthe output signal 360 as a frequency signal, VCO fout 360′. The FLL 320′further includes a frequency detector 504 that receives the digitalsignal 332 a and the output signal 360 of the FLL 320′, a charge pump510 and a filter 512. In one example, a signal provided by the filter512 is a voltage signal Vfa. As described further herein, the voltageVfa may be used in one or more embodiments (see, for example, FIG. 24).

Referring to FIG. 6, an example of the output current circuitry 318 isan output current circuitry 318′. The output current circuitry 318includes a decoder 602 and two-wire circuitry 604. The decoder 602receives the signal, VCO fout 360′, and the signal DIR. The decoder 602provides one of four signals (e.g., a signal EN1, a signal EN2, a signalEN3 and a signal EN4) to the two-wire circuitry 604. Based on the signalreceived (i.e., either EN1, EN2, EN3 or EN4), the two-wire circuitry 604generates the output signal 160′.

Referring to FIG. 7, an example of the decoder 602 (FIG. 6) is a decoder602′. The decoder 602′ includes AND gates 702, 704, 706, 708. The ANDgate 702 receives the VCO fout 360′ and the signal DIR and the AND gate702 outputs the signal EN2.

The AND gate 704 receives an inverted signal of the VCO fout signal360′, which is inverted by the inverter 716 and the signal DIR and theAND gate 704 outputs the signal EN3. When enabled signal EN1 or signalEN3 indicates a direction 1 rotation of the rotating magnet structure140 (FIG. 1A).

The AND gate 706 receives the VCO fout 360′ and an inverted signal ofthe signal DIR, which is inverted by the inverter 714 and the AND gate706 outputs the signal EN1. The AND gate 708 receives an inverted signalof the VCO fout signal 360′, which is inverted by the inverter 712 andthe inverted signal of the signal DIR and the AND gate 708 outputs thesignal EN4. When enabled, signal EN2 or signal EN4 indicates a direction2 rotation of the rotating magnet structure 140 (FIG. 1A).

Referring to FIGS. 8A and 8B, a regulator 522 provides a regulatedvoltage, Vreg from a supply voltage Vcc. An example of a two-wirecircuitry 604 is the two-wire circuitry 604′. The two-circuitry includesswitches 802, 804, 806, 808 that form a voltage divider with resistorsR₁, R₂, R₃, which provides a signal 820 to a first terminal of anoperational amplifier 712. The amplifier 712 h provides an output signalto a base of a transistor 716. In one example, the switch 802 is closedwhen enabled by the signal EN1, the switch 804 is closed when enabled bythe signal EN2, the switch 806 is closed when enabled by the signal EN3and the switch 808 is closed when enabled by the signal EN4. In oneexample, only one of the signals EN1, EN2, EN3 or EN4 is enabled at atime.

The drain of the transistor is connected to a supply voltage Vcc andreceives the output current Iout 160′. The drain of the transistor 716is connected to a second terminal of the operational amplifier 712 andto a resistor R₄ and ground.

The current the signal 820 depends on which of the signals, EN1, EN2,EN3 or EN4 is enabled. In one particular example, when EN1 is enabled,the switch 802 is closed and a 15 mA current is supplied in the signal820; when EN2 is enabled, the switch 804 is closed and a 11 mA currentis supplied in signal 820; when EN3 is enabled, the switch 806 is closedand a 4 mA current is supplied in the signal 820; and when EN4 isenabled, the switch 808 is closed and no current is supplied in thesignal 820.

Referring to FIG. 9, one example of the frequency detector 504 is afrequency detector 504′. The frequency detector 504′ includes aflip-flop 906 that receives a clock signal, Fin and a flip-flop 908 thatreceives a clock signal, Fout.

A signal, UP is a first output of the flip-flop 906 and a first outputof the frequency detector 504′. A signal DN is an output of theflip-flop 908. The signal DN is inverted by an inverter 912 to produce asecond output signal, DNN of the frequency detector 504′.

The frequency detector 504′ also includes a NAND gate 910, whichreceives the signal DN as a first input and receives the signal UP as asecond input to produce a signal RN. The signal, RN is provided to clear(CLR) inputs of the flip-flops 906, 908.

Referring to FIG. 10, in one example the charge pump 510 may be thecharge pump 510′ and an example of the filter 512 is a filter 512′. Thecharge pump 510′ includes a current source 1002, NMOS transistors 1004,1006, 1008, 1016 and PMOS transistors 1010. 1012, 1014. The currentsource 1002 is connected to the gates of the NMOS transistors 1004,1006, 1008 and the drain of NMOS transistor 1004 at one end and to thesources of the PMOS transistors 1010, 1012 at the other end. The sourcesof the NMOS transistors 1004, 1106, 1008 are connected to ground.

The gates of the PMOS transistors 1010, 1012 are connected. The gate anddrain of the PMOS transistor 1010 are tied to the drain of the NMOStransistor 1006. The drain of the PMOS transistor 1012 is connected tothe source of the PMOS transistor 1014. The source of the NMOStransistor 1014 is connected to the drain of the NMOS transistor 1008.

The signal, DNN from the frequency detector 504′ is connected to thegate of the PMOS transistor 1014 and the signal, UP from the frequencydetector 504′ is connected to the gate of the NMOS transistor 1016. Thedrain of the PMOS transistor 1014 is connected to the drain of the NMOStransistor 1016, which provides a signal 1018 to the filter 512′.

The filter 512′ includes an operational amplifier 1020 that receives thesignal 1018 from the charge pump 510′ at a first input and a secondinput of the operational amplifier 1020 is connected to ground. Thefilter 512′ include a capacitor C₁ connected in parallel with a resistorR₅ and a capacitor C₂, which are connected in parallel with theoperational amplifier 1020. The operational amplifier 1020 provides thesignal Vfa to the VCO 518.

FIG. 11 includes example waveforms using the circuits described in FIGS.9 and 10. For example, example waveforms of the signals Fin, Fout, UP,DN, RN and Vfa are signals are waveforms Fin 902, Fout 904, UP 914, DN918, RN 922 and Vfa, respectively.

Referring to FIGS. 12A and 12B, another example of the magnetic sensor130 is a magnetic field sensor 130″. The magnetic field sensor 130″generates an output signal Iout 160″. The output signal Iout 160″ may beused to provide the angular direction of a rotating magnet structure 140(FIG. 1A) and one of a speed of rotation of the rotating magnetstructure 140 or a fault (e.g., a fault in the IC 120 (FIG. 1)). In oneexample, the output signal Iout 160″ may vary between four currentlevels (e.g., I_(CC1), I_(CC2), I_(CC3) or I_(CC4)). In one particularexample, when the output signal Iout 160″ alternates between currentlevels I_(CC1), I_(CC4), may indicate that the rotating magnet 140 isrotating in a first direction (direction 1); and when the output currentsignal Iout 160″ alternates between current levels I_(CC2), I_(CC3), mayindicate that the rotating magnet 140 is rotating in a second direction(direction 2) opposite the first direction.

In one example, a frequency of the output signal Iout 160″ between Fmaxand Fmin correlates to the speed of rotation of the rotating magnetstructure 140 (FIG. 1). A frequency of the output signal Iout 160″ aboveFmax or below Fmin indicates that there is a fault. For example, the IC120 is overheating.

In one example, the magnetic field sensor 130″ includes the magneticfield sensing elements 302 a, 302 b, the converters 308 a, 308 b, thedigital processing circuitry 312 and the output current circuitry 318similar to the magnetic field sensor 130′. In a further example, themagnetic field sensor 130″ also includes the frequency detector 504, thecharge pump 510, the filter 512 and the VCO 518. An output of the VCO518 is the VCO fout 360′.

Unlike magnetic field sensor 130′, magnetic field sensor 130″ furtherincludes an analog multiplexor 516 between the filter 512 and the VCO518. In one example, the analog multiplexor 516 is a 4:1 multiplexorhaving input ports A, B, C, D.

The filter 512 provides an output signal, filter out 528, to the port Aof the analog multiplexor 516. The analog multiplexor 516 is alsoconfigured to receive signals from a fault voltage block 524 and ananalog multiplexor input select control 526 and is further configured toprovide an output signal, mux out 530, to the VCO 518.

For example, the fault voltage block 524 provides a signal, Vflow to theport B of the analog multiplexor 516 and a signal, Vfhi to the port C ofthe analog multiplexor 516. A signal, Vfmed is not provided to theanalog multiplexor 516 in this embodiment. The analog multiplexor inputselect control 26 receives control signals, Fault Lo Freq and Fault hiFreq, and provides select control signals, S1 and S2, to the analogmultiplexor 516. Which one of the signals at the ports A, B or C isselected depends on what the signals S1 and S2 are.

Referring to FIG. 13, an example of the output current circuitry 318 isan output current circuitry 318′. In one example, the output currentcircuitry 318′ includes a decoder 1302 and a two-wire circuitry 1304. Inone example, the decoder 1302 is the same as the decoder 602′ (FIG. 7)and the two-wire circuitry 1304 is the same as the two-wire circuitry604′ (FIG. 8) except the output signal is Iout 160″.

Referring to FIG. 14, a table 1400 illustrates one example of how theanalog multiplexor 516 functions. If there is no fault (i.e., thefrequency of output signal, Iout 160″ is between Fmin and Fmax), thenthe select control signals S1 and S2 are each ‘0’ and the signal, filterout 528 is selected from port A and provided to the VCO 518. If there isa fault in the low frequency (i.e., the frequency of output signal Iout160″ is below Fmin), then the select control signals S1 and S2 are ‘0’and ‘1’ respectively and the signal, Vflow is selected from port B andprovided to the VCO 518. If there is a fault in the high frequency(i.e., the frequency of output signal Iout 160″ is above Fmax), then theselect control signals S1 and S2 are ‘1’ and ‘0’ respectively and thesignal, Vfhi is selected from port C and provided to the VCO 518.

Referring to FIG. 15A, one example of the analog multiplexor inputselect control 526 is an analog multiplexor input select control 526′.The analog multiplexor input select control 526′ includes AND gates 1502and 1506. The AND gate 1502 receives the control signal, Fault hi Freq.The control signal, Fault Lo Freq, is inverted by the inverter 1512 andprovided as an input to the AND 1502. The AND gate 1502 provides anoutput signal, which is the select control signal, S1.

The AND gate 1506 receives the control signal, Fault Lo Freq. Thesignal, Fault hi Freq, is inverted by the inverter 1516 and provided asan input to the AND 1506. The AND gate 1506 provides an output signal,which is the select control signal, S2.

Referring to FIG. 15B, one example of the fault voltage block 524 is afault voltage block 524′. In one example, the fault voltage block 524′is a voltage divider that includes resistors, R₆, R₇, R₈, R₉ connectedin series with the voltage, Vreg, and ground. The signal, Vfhi isprovided between the resistors R₆, R₇; the signal, Vfmed is providedbetween the resistors R₇, R₈; and the signal, Vflow is provided betweenthe resistors R₈, R₉.

Referring to FIG. 15C, one example of the analog multiplexor 516 is ananalog multiplexor 516′. The analog multiplexor input 516′ includesswitches 1522, 1524, 1526, 1528 and AND gates 1530, 1532, 1534, 1536.The AND gate 1530 receives a signal S1N and a signal S2N to produce asignal SA. The signal S1N is provided by inverting the signal S1 usingan inverter 1542 and the signal S2N is provided by inverting the selectcontrol signal S2 using an inverter 1544.

The AND gate 1532 receives the signal S1N and the select control signalS2 to produce a signal SB. The AND gate 1534 receives the select controlsignal S1 and the signal S2N to produce a signal SA. The AND gate 1536receives the signal S1 and the select control signal S2 to produce asignal SD.

The signals SA, SB, SC, SC and SD are used to activate the switches1522, 1524, 1526, 1528 respectively. If the switch 1522 is activated, asignal InA is provided as the output signal 530; if the switch 1524 isactivated, a signal InB is provided as the output signal 530; if theswitch 1526 is activated, a signal InC is provided as the output signal530; if the switch 1528 is activated, a signal InD is provided as theoutput signal 530 as depicted in a table 1550 in FIG. 15D. In oneparticular example, the signal InA represents the signal filter out 528,the signal InB represents the signal Vflow and the signal InC representsthe signal Vfhi.

Referring to FIGS. 16 and 17, in another embodiment, speed and directionas well as faults may be determined from an output signal, Iout 160′″.In this embodiment, the output signal Iout 160′″ may be one of sixcurrent levels: I_(CC1b), I_(CC2b), I_(CC3b), I_(CC4b), I_(CC5) andI_(CC6). For example, the waveform 1602 depicts the output signal Iout160′″ alternating between I_(CC5) and I_(CC6). In this example, therotating magnet structure 140 (FIG. 1) is rotating in a direction 2. Thefrequency of the alternating between I_(CC5) and I_(CC6) indicates thespeed. There are no faults detected.

In another example, the waveform 1604 depicts the output signal, Iout160′″ alternating between I_(CC3b) and I_(CC1b). In this example, therotating magnet structure 140 (FIG. 1) is rotating in a direction 1opposite direction 2. The frequency of the alternating between I_(CC3b)and I_(CC4b) indicates the speed of the rotating magnet structure 140.There are no faults detected.

In a further example, the waveform 1606 depicts the output signal, Iout160′″ alternating between I_(CC1b) and I_(CC2b) when at least a faultcondition exists. In this example, the rotating magnet structure 140(FIG. 1) may be rotating in a direction 1 or a direction 2. Thefrequency of the alternating between I_(CC1b) and I_(CC2b) indicates thespeed.

In one example, output current circuitry in this embodiment is outputcurrent circuitry 318′″, which includes a decoder 1702 and a two-wireblock 1704. The decoder 1702 receives the signal, DIR, the VCO foutsignal 360 and a fault signal 1750. In one example, the decoder 1702provides one of six signals (signal EN1 b, signal EN2 b, signal EN3 b,signal EN4 b, signal EN5 and signal EN6) to the two-wire circuitry 1704.In one particular example, when the signal EN1 b is provided, the outputsignal Iout 160′″ is equal to the current level I_(CC1b); when thesignal EN2 b is provided, the output signal Iout 160′″ is equal to thecurrent level I_(CC2b); when the signal EN3 b is provided, the outputsignal Iout 160′″ is equal to the current level I_(CC3b); when thesignal EN4 b is provided, the output signal Iout 160′″ is equal to thecurrent level I_(CC4b); when the signal EN5 is provided, the outputsignal Iout 160′″ is equal to the current level I_(CC5); and when thesignal EN6 is provided, the output signal Iout 160′″ is equal to thecurrent level I_(CC6).

Referring to FIG. 18, one example of the decoder 1702 is a decoder1702′. The decoder 1702′ includes an AND gate 1902, an AND gate 1904, anAND gate 1906, an AND gate 1908, an AND gate 1910, and an AND gate 1912.The AND gate 1902 receives the direction signal 344, the VCO fout signal360 and an inverted signal of the fault signal 1750, which is invertedby the inverter 1924, to form the signal EN1 b. The AND gate 1904receives the direction signal 344, an inverted signal of the VCO foutsignal 360, which is inverted by an inverter 1922 and the invertedsignal of the fault signal 1750, which is inverted by the inverter 1924to form the signal EN2 b.

The AND gate 1906 receives the VCO fout signal 360 and the fault signal1750 to form the signal EN5. The AND gate 1908 receives an invertedsignal of the VCO fout signal 360, which is inverted by an inverter 1926and the fault signal 1750 to form the signal EN6.

The AND gate 1910 receives an inverted signal of the signal DIR, whichis inverted by an inverter 1930; the VCO fout signal 360 and an invertedsignal of the fault signal 1750, which is inverted by the inverter 1928,to form the signal EN3 b. The AND gate 1912 receives the inverted signalof the signal DIR, which is inverted by the inverter 1930; an invertedsignal of the VCO fout signal 360, which is inverted by an inverter 1932and the inverted signal of the fault signal 1750, which is inverted bythe inverter 1928, to form the signal EN4 b.

Referring to FIG. 19, an example of a two-wire circuitry 1704 is thetwo-wire circuitry 1704′. The two-wire circuitry 1704′ includes switches1802, 1804, 8106, 1808, 1810, 1812 that form a voltage divider withresistors R₁₀, R₁₁, R₁₂, R₁₃, R₁₄, which provides a signal 1820 to afirst terminal of an operational amplifier 712, which provides an outputsignal to a base of a transistor 716.

In one example, the switch 1802 is closed when enabled by the signal EN1b, the switch 1804 is closed when enabled by the signal EN2 b, theswitch 1806 is closed when enabled by the signal EN3 b, the switch 1808is closed when enabled by the signal EN4 b, the switch 1810 is closedwhen enabled by the signal EN5, the switch 1812 is closed when enabledby the signal EN6. In one example, only one of the signals EN1 b, EN2 b,EN3 b, EN4 b, EN5, EN6 is enabled at a time.

Referring to FIG. 20, in a still further embodiment, the frequency ofthe output signal. Iout 160 (FIG. 1) may also be used to identify one ormore faults. In one particular example, frequency between 0 and 200 Hzindicates a first fault 2002, a frequency between 10.2 kHz and 12.2 kHzindicates a second fault 2004 and a frequency between 22.2 kHz indicatesa third fault 2006.

The frequency between 201 Hz and 10.19 kHz indicates that the rotatingmagnet is rotating in a first direction. The speed of the rotatingmagnet in the first direction is slower for frequencies near 10.19 kHzthan for frequencies near 200 Hz.

The frequency 12.3 kHz to 22.1 kHz indicates that the rotating magnet isrotating in a second direction opposite the first direction. The speedof rotating magnet is slower for frequencies near 12.3 kHz than forfrequencies near 22.1 kHz.

Referring to FIG. 21, a further example of a magnetic field sensor 130(FIG. 1) is a magnetic field sensor 2130, which provides one or morefaults, for example, as depicted in FIG. 20 by taking the frequency ofthe output signal, Iout 160″″. In one example, the magnetic field sensor130″″ includes an output control digital multiplexor 2102 and a two-wireblock 2104. The output control digital multiplexor 2102 signal receivesa signal, Direction 1 2110 and a signal, Direction 2 2112 and selectswhich of the signals to output based on the signal, DIR as a signal2114. The signal 2114 is sent to one of the ports of the two-wire block2104 (e.g., port 2) and the signal 2114 is inverted by the inverter 2114and sent to another port of the two-wire block 2104 (e.g., port 3).

Referring to FIG. 22, in order to produce the signal Direction 1 2110,the magnetic field sensor 2130 further includes similar components tothe magnetic field sensor 130′ such as the magnetic field sensingelements 302 a, 302 b, the converters 308 a, 308 b, the digitalprocessing circuitry 312 and the FLL 320. The output of the FLL 320produces the signal, Direction 1 2110.

Referring to FIG. 23, in order to produce the signal Direction 2 2112,the magnetic field sensor 2130 further includes an analog multiplexor2302, a VCO 2304 and an analog multiplexor input select control 2306. Inone example, the analog multiplexor 2302 is the same as the analogmultiplexor 516 (FIG. 12A). In another example, the analog multiplexor2302 is the same as the analog multiplexor 516′ (FIG. 15C). The analogmultiplexor 2302 receives the signal Vflow at a port A, the signal VFmedat a port B a signal Vdir2 at a port C and the signal Vfhi at a port D.The analog multiplexor input select control 2306 receives three controlsignal, Fault Lo, Fault Med and Fault Hi to determine the select controlsignals S1 and S2.

The analog multiplexor 2302 receives select control signals, S1 and S2,from the analog multiplexor input select control 2306 then selects whichsignal received at the ports A, B, C or D is sent to the VCO 2304.

In one example, the signals Vflow, Vfmed and Vfhi are generated usingthe fault voltage block 524′. In one example, the signal Vflowcorresponds to the first fault 2002, the signal Vfmed corresponds to thesecond fault 2004 and Vfhi corresponds to the fault 2006.

Referring to FIG. 24, in order to form the signal Vdir2, the magneticfield sensor 130″″ further includes a frequency/voltage converter 2402and an adder 2404. The signal Vfa (FIG. 5) is increased by a voltagecorresponding to 10 kHz, for example, by the adder 2404 to form thesignal Vdir2.

Referring to FIG. 25, an example of the analog multiplexor input selectcontrol 2306 is an analog multiplexor input select control 2306′. Theanalog multiplexor input select control 2306′ includes inverters 2502,2504, 2506; an OR gates 2532; NOR gates 22512, 514, 2534 and an AND gate2520.

The inverter 2502 inverts the control signal Fault (Lo freq) signal toform a signal XN. The inverter 2504 inverts the control signal Fault(Med freq) signal to form a signal YN. The inverter 2506 inverts thecontrol signal Fault (hi freq) signal to form a signal ZN.

The NOR gate 2512 receives the control signal Fault (Lo freq) signal,the control signal Fault (Med freq) signal and the signal ZN. The NORgate 2514 receives the control signal Fault (Med freq) signal and thecontrol signal Fault (hi freq) signal. The AND gate receives signals,XN, YN and ZN.

The OR gate 2532 receives the outputs from the NOR gate 2512 and the ANDgate 2520 to produce the select control signal S1. The NOR gate 2534receives the outputs from the NOR gate 2514 and the AND gate 2520, andthe control signal Fault (Lo freq) to produce the select control signalS2.

Referring to FIG. 26, a table 2600 illustrates one example of how theanalog multiplexor 2302 functions. If there is a low frequency fault(e.g., a fault 2002 (FIG. 20), then the select control signals S1 and S2are each ‘0’ and the signal, Vflow is selected from port A and providedto the VCO 2304. If there is a medium frequency fault (e.g., a fault2004 (FIG. 20), then the select control signals S1 and S2 are ‘0’ and‘1’ respectively and the signal, Vfmed is selected from port B andprovided to the VCO 2304. If there is no fault, then the select controlsignals S1 and S2 are ‘1’ and ‘0’ respectively and the signal, Vfdir isselected from port C and provided to the VCO 2304. If there is a highfrequency fault (e.g., a fault 2006 (FIG. 20), then the select controlsignals S1 and S2 are each ‘1’ and the signal, Vfhi is selected fromport D and provided to the VCO 2304.

Referring to FIGS. 27 and 28, in a still further embodiment, a dutycycle of a pulse width modulation (PWM) output may be used to determineif a fault exists. In one particular example, a duty cycle between 1% to10%, 40% to 60% and 90% to 99% may indicate that a fault exists. A dutycycle between 11% and 39% may indicate that the rotating magneticstructure 140 (FIG. 1) is rotating in a direction 1 and a duty cyclebetween 61% and 89% may indicate that the rotating magnetic structure140 is rotating a direction 2 opposite the direction 1.

An example of the magnetic field sensor 130 in this embodiment is amagnetic field sensor 2830. Similar to the magnetic field sensor 130′,the magnetic field sensor 2830 includes the magnetic field sensingelement 302 a and the converter 308 a that form the Channel A andincludes the magnetic field sensing element 302 b and the converter 304b that form the Channel B. The magnetic field sensor 2830 also includesa digital processing block 2806 that receives input from the Channels Aand B and provides an output to a two-wire output current circuit 2808,which provides an IC output signal 2860 in the form of a PWM output.

Referring to FIG. 29, an example of a process to generate a PWM outputis a process 2900. Process 2900 waits until a rising edge of channel A(2902) and counts clock edges until the next rising edge in Channel A(2908).

Process 2900 determines pulse width percentage based on clock edgesdetermined (2912). For example, the total number of clock edgesdetermined in processing block 2908 is converted to speed and the speedis used to determine a pulse width percentage. For example, speed inrevolutions per minute (RPM) is equal to 60 seconds divided by theproduct of the number of clock edges times 1 microsecond. In oneexample, a lookup table or an equation may be used to determine thepulse width percentage using the speed. In one particular example, thecarrier frequency is 1 kHz.

One example of a look-up table is:

Pulse width Magnet target Duty 1 uSec Clock for 1 kHz FrequencyDirection cycle edges carrier 1 rpm Direction 1 10% 10,000,000 100microSec 10K rpm ″ 40% 6000 400 microSec 1 rpm Direction 2 60%10,000,000 600 microSec 10K rpm ″ 90% 6000 900 microSec

In a further example, an equation may be derived to represent the targetspeed and convert it to pulse width modulated duty cycle. In oneparticular example, using the assumptions that 1 RPM is 10% pulse width,and 10,000 RPM is 40% pulse width, the following equation may be usedfor direction 1:Direction 1 Pulse Width (in%)=(10+[Log₁₀(speed)*7.5])=(10+[Log₁₀(6E+07/Clks)*7.5]),where Clks equals to the number of clock edges determined in processingblock 2912.For instance if speed is 1, then [Log₁₀(1) is 0, so Pulse Width is 10%.If speed is 10000, then Log₁₀(10000) is 4, so PulseWidth=(10+[4*7.5])=40.

For direction 2 with 60 to 90% pulse width, the equation would be:Direction 2 Pulse Width (in %)=(60+[Log 10(speed)*7.5])=(60+[Log10(6E+07/Clks)*7.5]).

In other examples, a different equation may be derived for 0.1 or 0 RPM,or the definition of the pulse width for minimum speed (say 10.1%) andmaximum speed pulse width of 39.9% may be changed.

Process 2900 updates the previous pulse width percentage with the newpulse width percentage (2918) and stores the pulse width percentage(2922). In one example, the pulse width percentage is a pulse widthpercentage 3020 stored in a non-volatile memory 3006 (FIG. 30). Afterprocessing block 2918, process 2900 also repeats processing blocks 2902,2908, 2912, 2918.

Process 2900 generates an output for a period of time using the pulsewidth percentage stored (2926). For example, assuming a 1 kHz carrier, a1,000 microsec output is started remaining high based on the store pulsewidth percentage and low for the remainder of the 1,000 microseconds.

Process 2900 repeats processing block 2926. For example, after the 1,000microseconds in the previous example, process 2900 repeats processingblock 2926 for the next 1,000 microseconds.

Referring to FIG. 30, an example of the digital processing circuitry2806 is digital processing circuitry 2806′. The digital processingcircuitry 2806′ includes a processor 3002, a volatile memory 3004 and anon-volatile memory 3006. Non-volatile memory 3006 includes an operatingsystem 3016; data 3018, which includes the pulse width percentage 3020;and instructions 3012, which are executed out of volatile memory 3004 toperform all or part of process 2900.

The processes described herein (e.g., process 2900) are not limited touse with the hardware of FIG. 30; they may find applicability in anycomputing or processing environment and with any type of machine or setof machines that is capable of running a computer program. The processesdescribed herein may be implemented in hardware, software, or acombination of the two. The processes described herein may beimplemented in computer programs executed on programmablecomputers/machines that each includes a processor, a non-transitorymachine-readable medium or other article of manufacture that is readableby the processor (including volatile and non-volatile memory and/orstorage elements), at least one input device, and one or more outputdevices. Program code may be applied to data entered using an inputdevice to perform any of the processes described herein and to generateoutput information.

The processing blocks (for example, in the process 2900) associated withimplementing the system may be performed by one or more programmableprocessors executing one or more computer programs to perform thefunctions of the system. All or part of the system may be implementedas, special purpose logic circuitry (e.g., an FPGA (field-programmablegate array) and/or an ASIC (application-specific integrated circuit)).All or part of the system may be implemented using electronic hardwarecircuitry that include electronic devices such as, for example, at leastone of a processor, a memory, a programmable logic device or a logicgate.

The processes described herein are not limited to the specific examplesdescribed. For example, the process 2900 is not limited to the specificprocessing order of FIG. 29. Rather, any of the processing blocks ofFIG. 29 may be re-ordered, combined or removed, performed in parallel orin serial, as necessary, to achieve the results set forth above.

Elements of different embodiments described herein may be combined toform other embodiments not specifically set forth above. Variouselements, which are described in the context of a single embodiment, mayalso be provided separately or in any suitable subcombination. Otherembodiments not specifically described herein are also within the scopeof the following claims.

What is claimed is:
 1. An integrated circuit (IC) comprising: a magneticfield sensor to detect speed and direction of angular rotation of arotating magnetic structure, the magnetic field sensor comprising: atleast two magnetic field sensing elements configured to sense changes ina magnetic field caused by rotation of the magnetic structure; and anoutput port configured to provide an output signal of the magnetic fieldsensor, the output signal indicating the angular direction and one ofthe speed or a fault, wherein the output signal at a first value or at asecond value indicating the magnetic structure rotating in a firstdirection, wherein the output signal at a third value or at a fourthvalue indicating the magnetic structure rotating in a second directionopposite the first direction, wherein no two values of the first value,the second value, the third value or the fourth value are equal.
 2. TheIC of claim 1, wherein a frequency of the output signal indicates thespeed or a fault.
 3. The IC of claim 2, wherein the frequency within afrequency range indicates the speed.
 4. The IC of claim 3, wherein thefrequency below the frequency range indicates one or more faults.
 5. TheIC of claim 3, wherein the frequency above the frequency range indicatesone or more faults.
 6. The IC of claim 3, wherein the frequency aboveand below the frequency range indicates one or more faults.
 7. The IC ofclaim 1, wherein the magnetic structure is a ring magnet.
 8. The IC ofclaim 1, wherein at least one of the magnetic sensing elements is aHall-effect element.
 9. The IC of claim 1, wherein an amplitude of theoutput signal indicates the angular direction.
 10. The IC of claim 1,wherein the output signal is a current signal.
 11. The IC of claim 1,wherein the fault indicating at least one of: a loose wire, malfunctionof the IC, a gap between the magnetic structure and the IC being aboveor below a distance threshold or a temperature of the IC exceeds atemperature threshold.
 12. The IC of claim 1, wherein at least one ofthe at least two magnetic field sensing elements comprises at least oneof a Hall effect element, a magnetoresistance element, or amagnetotransistor.
 13. The IC of claim 12, wherein the magnetoresistanceelement comprises at least one of a giant magnetoresistance (GMR)element, an anisotropic magnetoresistance element (AMR), a tunnelingmagnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ).14. An integrated circuit (IC) comprising: a magnetic field sensor todetect speed and direction of angular rotation of a rotating magneticstructure, the magnetic field sensor comprising: at least two magneticfield sensing elements configured to sense changes in a magnetic fieldcaused by rotation of the magnetic structure; and an output portconfigured to provide an output signal of the magnetic field sensor, theoutput signal indicating the angular direction and one of the speed or afault, wherein the output signal at a first value or at a second valueindicating the magnetic structure rotating in a first direction, whereinthe output signal at a third value or at a fourth value indicating themagnetic structure rotating in a second direction opposite the firstdirection, wherein the first value and the third value are equal. 15.The IC of claim 14, wherein a frequency of the output signal indicatesthe speed or a fault, wherein the frequency within a frequency rangeindicates the speed, wherein the frequency below the frequency rangeindicates one or more faults, and wherein the frequency above thefrequency range indicates one or more faults.
 16. The IC of claim 14,wherein the magnetic structure is a ring magnet.
 17. The IC of claim 14,wherein at least one of the magnetic sensing elements is a Hall-effectelement.
 18. The IC of claim 14, wherein an amplitude of the outputsignal indicates the angular direction.
 19. The IC of claim 14, whereinthe output signal is a current signal.
 20. The IC of claim 14, whereinthe fault indicating at least one of: a loose wire, malfunction of theIC, a gap between the magnetic structure and the IC being above or belowa distance threshold or a temperature of the IC exceeds a temperaturethreshold.
 21. The IC of claim 14, wherein at least one of the at leasttwo magnetic field sensing elements comprises at least one of a Halleffect element, a magnetoresistance element, or a magnetotransistor. 22.The IC of claim 21, wherein the magnetoresistance element comprises atleast one of a giant magnetoresistance (GMR) element, an anisotropicmagnetoresistance element (AMR), a tunneling magnetoresistance (TMR)element, or a magnetic tunnel junction (MTJ).
 23. An integrated circuit(IC) comprising: a magnetic field sensor to detect speed and directionof angular rotation of a rotating magnetic structure, the magnetic fieldsensor comprising: at least two magnetic field sensing elementsconfigured to sense changes in a magnetic field caused by rotation ofthe magnetic structure; and an output port configured to provide anoutput signal of the magnetic field sensor, the output signal indicatingthe angular direction and one of the speed or a fault, wherein themagnetic field sensor further comprises: a first converter configured toconvert a first signal from a first magnetic field sensing element to afirst digital signal; a second converter configured to convert a secondsignal from a second magnetic field sensing element to a second digitalsignal; direction detection circuitry configured to receive the firstdigital signal and the second digital signal and to provide a directionsignal; a frequency locked loop configured to receive the first digitalsignal and to provide a frequency signal; a decoder to receive thedirection signal and the frequency signal; and a two-wire circuitconfigured to receive at least three signals from the decoder and toprovide the output signal.
 24. The IC of claim 23, wherein the two-wirecircuit is configured to receive four signals from the decoder.
 25. TheIC of claim 23, wherein the two-wire circuit comprises: a voltagedivider; and an operational amplifier coupled to the voltage divider,wherein the at least three signals are configured to enable gates in thevoltage divider.
 26. An integrated circuit (IC) comprising: a magneticfield sensor means to detect speed and direction of angular rotation ofa rotating magnetic structure, the magnetic field sensor meanscomprising: a means to sense changes in a magnetic field caused byrotation of the magnetic structure; and an output port configured toprovide an output signal of the magnetic field sensor means, the outputsignal indicating the angular direction and one of the speed or a fault,wherein the output signal at a first value or at a second valueindicating the magnetic structure rotating in a first direction, whereinthe output signal at a third value or at a fourth value indicating themagnetic structure rotating in a second direction opposite the firstdirection, wherein the first value and the third value are equal. 27.The IC of claim 26, wherein a frequency of the output signal indicatesthe speed or a fault, wherein the frequency within a frequency rangeindicates the speed, wherein the frequency below the frequency rangeindicates one or more faults, and wherein the frequency above thefrequency range indicates one or more faults.
 28. The IC of claim 26,wherein the magnetic structure is a ring magnet.
 29. The IC of claim 26,wherein at least one of the magnetic sensing elements is a Hall-effectelement.
 30. The IC of claim 26, wherein an amplitude of the outputsignal indicates the angular direction.
 31. The IC of claim 26, whereinthe output signal is a current signal.
 32. The IC of claim 26, whereinthe fault indicating at least one of: a loose wire, malfunction of theIC, a gap between the magnetic structure and the IC being above or belowa distance threshold or a temperature of the IC exceeds a temperaturethreshold.
 33. The IC of claim 26, wherein at least one of the at leasttwo magnetic field sensing elements comprises at least one of a Halleffect element, a magnetoresistance element, or a magnetotransistor. 34.The IC of claim 33, wherein the magnetoresistance element comprises atleast one of a giant magnetoresistance (GMR) element, an anisotropicmagnetoresistance element (AMR), a tunneling magnetoresistance (TMR)element, or a magnetic tunnel junction (MTJ).
 35. An integrated circuit(IC) comprising: a magnetic field sensor to detect speed and directionof angular rotation of a rotating magnetic structure, the magnetic fieldsensor comprising: at least two magnetic field sensing elementsconfigured to sense changes in a magnetic field caused by rotation ofthe magnetic structure; and an output port configured to provide anoutput signal of the magnetic field sensor, the output signal indicatingthe angular direction of the rotating magnetic structure and a faultindicator, wherein a frequency of the output signal is the faultindicator indicating no faults are detected or a fault is detected,wherein the frequency within a frequency range indicates no faults aredetected and the speed of the rotating magnetic structure, wherein thefrequency below the frequency range indicates one or more faults, andwherein the frequency above the frequency range indicates one or morefaults.
 36. The IC of claim 35, wherein the rotating magnetic structureis a ring magnet.
 37. The IC of claim 35, wherein at least one of themagnetic sensing elements is a Hall-effect element.
 38. The IC of claim35, wherein an amplitude of the output signal indicates the angulardirection.
 39. The IC of claim 35, wherein the output signal is acurrent signal.
 40. The IC of claim 35, wherein the fault indicating atleast one of: a loose wire, malfunction of the IC, a gap between themagnetic structure and the IC being above or below a distance thresholdor a temperature of the IC exceeds a temperature threshold.
 41. The ICof claim 35, wherein at least one of the at least two magnetic fieldsensing elements comprises at least one of a Hall effect element, amagnetoresistance element, or a magnetotransistor.
 42. The IC of claim41, wherein the magnetoresistance element comprises at least one of agiant magnetoresistance (GMR) element, an anisotropic magnetoresistanceelement (AMR), a tunneling magnetoresistance (TMR) element, or amagnetic tunnel junction (MTJ).
 43. An integrated circuit (IC)comprising: a magnetic field sensor means to detect speed and directionof angular rotation of a rotating magnetic structure, the magnetic fieldsensor means comprising: a means to sense changes in a magnetic fieldcaused by rotation of the magnetic structure; and an output portconfigured to provide an output signal of the magnetic field sensormeans, the output signal indicating the angular direction and one of thespeed or a fault, wherein the output signal at a first value or at asecond value indicating the magnetic structure rotating in a firstdirection, wherein the output signal at a third value or at a fourthvalue indicating the magnetic structure rotating in a second directionopposite the first direction, wherein no two values of the first value,the second value, the third value or the fourth value are equal.
 44. TheIC of claim 43, wherein a frequency of the output signal indicates thespeed or a fault.
 45. The IC of claim 44, wherein the frequency within afrequency range indicates the speed.
 46. The IC of claim 45, wherein thefrequency below the frequency range indicates one or more faults. 47.The IC of claim 45, wherein the frequency above the frequency rangeindicates one or more faults.
 48. The IC of claim 45, wherein thefrequency above or below the frequency range indicates one or morefaults.
 49. The IC of claim 45, wherein the magnetic structure is a ringmagnet.
 50. The IC of claim 43, wherein an amplitude of the outputsignal indicates the angular direction.
 51. The IC of claim 43, whereinthe output signal is a current signal.
 52. The IC of claim 43, whereinthe fault indicating at least one of: a loose wire, malfunction of theIC, a gap between the magnetic structure and the IC being above or belowa distance threshold or a temperature of the IC exceeds a temperaturethreshold.